<template>
  <div class="help-item">
    <div v-if="newItem.children==null">
      <articleBlock :itemId="newItem.itemId" :itemName="newItem.itemName"/>
    </div>
    <div v-else>
      <articleBlock v-for="item in newItem.children" :itemId="item.data.itemId" :itemName="item.data.itemName"/>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, toRefs } from "vue";
import articleBlock from "./articleBlock.vue";
export default defineComponent({
  name: "helpItem",
  components: {
    articleBlock
  },
  props: {
    newItem: {
      type: Object,
      default: {}
    }
  },
  setup(props) {
    const { newItem } = toRefs(props);

    console.log(newItem.value);
    return {
      newItem
    }
  }
})
</script>

<style lang="less" scoped>
.help-item {
  width: 1200px;
  padding-bottom: 100px;
  margin: 0 auto;
}
</style>
